package br.com.orion.sga.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import br.com.orion.sga.exception.DaoException;
import br.com.orion.sga.model.dao.ResponsavelDao;
import br.com.orion.sga.model.entities.Responsavel;

@Service
public class ResponsavelService {
	
	@Autowired
	private ResponsavelDao responsavelDao;
	
	
	/**
	 * save Reponsible
	 * @param responsavel
	 * @throws DaoException
	 */
	public void save(Responsavel responsavel) throws DaoException {
		responsavelDao.save(responsavel);
	}
	
	/**
	 * update responsible
	 * @param responsavel
	 * @throws DaoException
	 */
	public void update(Responsavel responsavel) throws DaoException {
		responsavelDao.update(responsavel);
	}
	
	/**
	 * delete responsible
	 * @param responsavel
	 * @throws DaoException
	 */
	public void delete(Responsavel responsavel) throws DaoException {
		responsavelDao.delete(responsavel);
	}
	
	
	/**
	 * @return the all data of table responsavel
	 */
	public List<Responsavel> listAll() {
		return responsavelDao.listAll();
	}

	/**
	 * get one responsible by its Id
	 * @param idOfReponsible
	 * @return responsible
	 */
	public Responsavel getById(long idOfReponsible) {
		return responsavelDao.getById(idOfReponsible);
	}
	
	
	/**
	 * get Responsible by CPF
	 * @param cpf
	 * @return
	 */
	public Responsavel getByCPF(String cpf) throws DaoException{
		return responsavelDao.getByCPF(cpf);
	}
	

}
